package cn.secondquestion;

public class Trapezoid extends Graph{
    private int i;
    private int a;
    private int b;
    public Trapezoid(){

    }


    public Trapezoid(int h, int l, int i, int a, int b) {
        super(h, l);
        this.i = i;
        this.a = a;
        this.b = b;
    }

    public int getI() {
        return i;
    }

    public void setI(int i) {
        this.i = i;
    }

    public int getA() {
        return a;
    }

    public void setA(int a) {
        this.a = a;
    }

    public int getB() {
        return b;
    }

    public void setB(int b) {
        this.b = b;
    }

    public void area(){
        int s=(getI()+getL())*getH()/2;
        System.out.println("梯形的面积为:"+s);
    }
    public void  perimeter(){
        int l=getH()+getL()+getA()+getB()+getI();
        System.out.println("梯形的周长为:"+l);
    }
}
